package com.heima.comment.controller.v1;

import com.heima.comment.service.CommentRepayService;
import com.heima.model.comment.dtos.CommentRepayDTO;
import com.heima.model.comment.dtos.CommentRepayLikeDTO;
import com.heima.model.comment.dtos.CommentRepaySaveDTO;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@Api("回复点赞的借口")
@RequestMapping("/api/v1/comment_repay")
public class CommentRepayController {
    @Autowired
    private CommentRepayService commentRepayService;


    @PostMapping("/load")
    public ResponseResult loadCommentRepay(@RequestBody @Validated CommentRepayDTO dto){
        return  commentRepayService.loadCommentRepay(dto);
    }

    @PostMapping("/save")
    public ResponseResult saveCommentRepay(@RequestBody @Validated CommentRepaySaveDTO dto){
        return  commentRepayService.saveCommentRepay(dto);
    }

    @PostMapping("/like")
    public ResponseResult saveCommentRepayLike(@RequestBody @Validated CommentRepayLikeDTO dto){
        return  commentRepayService.saveCommentRepayLike(dto);
    }



}
